package netTracker.network;


public class EchoServer
{	public static final int ECHO_P = 7880;

	public static void main (String[] args) throws Exception{	
		Address localAddress = new Address ("127.0.0.1", ECHO_P);
		PostOffice pobox = new PostOffice (localAddress);
		AddressFactory myAddrFactory = new AddressFactory(pobox);

		localAddress = myAddrFactory.makeAddress(localAddress);
		System.out.println("Joined name server. new address: "+localAddress);
		
		Message m;

		while (true)
		{	m = pobox.receive ();
			pobox.send (m, m.getSrc ());
		}
	} // main
} 
